
var arr = [1,2,3,4,5,3,2,1]

var set = new Set();

arr.forEach(s=> set.add(s));

// console.log(set)


var brr = [];

set.forEach(s => brr.push(s))

console.log('brr',brr)

var  crr = [...new Set(arr)];

console.log('crr',crr)